package com.example.doctorsystem.service.impl;

import com.example.doctorsystem.dao.MedicineDao;
import com.example.doctorsystem.model.Medicine;
import com.example.doctorsystem.service.MedicineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicineServiceImpl implements MedicineService {

    @Autowired
    private MedicineDao medicineDao;

    @Override
    public int addMedicine(Medicine medicine) {
        return medicineDao.addMedicine(medicine);
    }

    @Override
    public List<Medicine> getAllMedicines() {
        return medicineDao.getAllMedicines();
    }

    @Override
    public Medicine getMedicineById(int id) {
        return medicineDao.getMedicineById(id);
    }

    @Override
    public int updateMedicine(Medicine medicine) {
        return medicineDao.updateMedicine(medicine);
    }

    @Override
    public int deleteMedicineById(int id) {
        return medicineDao.deleteMedicineById(id);
    }
}
